/**
 * The ClientComplaintimplement the complaint by client.
 * This class extends the Notification class.
 * Each instance of this class will be a new complaint to the customer service agents.
 * 
 * @author Gil Levinson
 * @author Boris Fradlis
 * @author Yogev Levi
 * @author Hila Porat
 * 
 * 
 */

package vcpClasses;
import java.io.Serializable;
import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.Date;

// Start of ClientComplaint *************************************************

public class ClientComplaint extends Notification{
	
	// Class variables ******************************************************
	
	
	private float refund;
	private String complaintDate;
	private String complaintTime;
	
	// Constructors ***********************************************************
	
	/**
	 * No implementation constructor
	 */
	
	public ClientComplaint(){}
	
	/**
	 * Constructor Using the following fields:
	 * @param type The subject of the complaint
	 * @param content the content of the complaint
	 * @param sender the complaining client
	 */
	
	public ClientComplaint(String type, Serializable content, String sender){
		this.setType(type);
		this.setContent(content);
		this.setSender(sender);
		this.setReceiver("Customer Service");
		this.setRefund(0);
		Date date = new Date();
		SimpleDateFormat thedate = new SimpleDateFormat("yyyy-MM-dd");
		this.complaintDate = thedate.format(date);
		SimpleDateFormat thetime = new SimpleDateFormat("HH:mm");
		this.complaintTime = thetime.format(date);
	}
	
	/**
	 * Constructor Using the following field:
	 * @param refund the refund for the client
	 */
	
	public ClientComplaint(float refund){
		super();
		this.setRefund(refund);
		Date date = new Date();
		SimpleDateFormat thedate = new SimpleDateFormat("yyyy-MM-dd");
		this.complaintDate = thedate.format(date);
		SimpleDateFormat thetime = new SimpleDateFormat("HH:mm");
		this.complaintTime = thetime.format(date);
	}
	
	// Getters And Setters ******************************************************************

	/**
	 * @return the refund
	 */
	public float getRefund() {
		return refund;
	}

	/**
	 * @param refund the refund to set
	 */
	public void setRefund(float refund) {
		this.refund = refund;
	}

	/**
	 * @return the complaintDate
	 */
	public String getComplaintDate() {
		return complaintDate;
	}

	/**
	 * @param complaintDate the complaintDate to set
	 */
	public void setComplaintDate(String complaintDate) {
		this.complaintDate = complaintDate;
	}

	/**
	 * @return the complaintTime
	 */
	public String getComplaintTime() {
		return complaintTime;
	}

	/**
	 * @param complaintTime the complaintTime to set
	 */
	public void setComplaintTime(String complaintTime) {
		this.complaintTime = complaintTime;
	}
	
	
}
